﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterALSafa.Master" AutoEventWireup="true"
    CodeBehind="TE_Course.aspx.cs" Inherits="School.Pages.Teaching.TE_Course" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div>
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
        </div>
        <div style="padding: 1px 10px">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <div>
                        المجمع
                    </div>
                    <div>
                        <asp:DropDownList ID="ddlCampus" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                            DataTextField="Name" DataValueField="Id" OnTextChanged="ddlCampus_TextChanged"
                            Width="150px">
                            <asp:ListItem Value="0">اختيار</asp:ListItem>
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="ddlCampus"
                            Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st">*</asp:RequiredFieldValidator>
                    </div>
                    <div>
                        الشهاده
                    </div>
                    <div>
                        <asp:DropDownList ID="ddlCertificate" runat="server" AppendDataBoundItems="True"
                            AutoPostBack="True" DataTextField="Name" DataValueField="Id" OnSelectedIndexChanged="ddlCertificate_SelectedIndexChanged"
                            Width="150px" TabIndex="1">
                            <asp:ListItem Value="0">اختيار</asp:ListItem>
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="ddlCertificate"
                            Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st">*</asp:RequiredFieldValidator>
                    </div>
                    <div>
                        المرحله
                    </div>
                    <div>
                        <asp:DropDownList ID="ddlStadge" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                            DataTextField="Name" DataValueField="Id" OnSelectedIndexChanged="ddlStadge_SelectedIndexChanged"
                            Width="150px" TabIndex="2">
                            <asp:ListItem Value="0">اختيار</asp:ListItem>
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="ddlStadge"
                            Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st">*</asp:RequiredFieldValidator></div>
                    <div>
                        الصف
                    </div>
                    <div>
                        <asp:DropDownList ID="ddlGrade" runat="server" AppendDataBoundItems="True" DataTextField="Name"
                            DataValueField="Id" Width="150px" TabIndex="3" AutoPostBack="True" OnSelectedIndexChanged="ddlGrade_SelectedIndexChanged">
                            <asp:ListItem Value="0">اختيار</asp:ListItem>
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="ddlGrade"
                            Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st">*</asp:RequiredFieldValidator>
                    </div>
                    <div>
                        المادة
                    </div>
                    <div>
                        <asp:DropDownList ID="ddlsubject" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                            DataTextField="Sub_name" DataValueField="Id" OnSelectedIndexChanged="ddlsubject_SelectedIndexChanged"
                            Width="150px">
                            <asp:ListItem Value="0">اختيار</asp:ListItem>
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" ControlToValidate="ddlsubject"
                            Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st"></asp:RequiredFieldValidator>
                    </div>
                    <div>
                        اسم الوحدة
                    </div>
                    <div>
                        <asp:TextBox ID="txtname" runat="server" Width="150px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ControlToValidate="txtname"
                            Display="Dynamic" ErrorMessage="*" ForeColor="Red" ValidationGroup="st"></asp:RequiredFieldValidator>
                    </div>
                    <div>
                        الوصف
                    </div>
                    <div>
                        <asp:TextBox ID="txtdis" runat="server" TextMode="MultiLine"></asp:TextBox>
                    </div>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
        <div>
            <div style="padding: 5px">
                <asp:Button ID="btnSave" runat="server" CssClass="graybutton" Text="اضافة" OnClick="btnSave_Click" />
            </div>
            <div>
                <asp:Label ID="lbltst" runat="server" Visible="False"></asp:Label>
            </div>
        </div>
        <div>
            <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                <ContentTemplate>
                    <asp:Label ID="lblgrid" runat="server" Visible="False"></asp:Label>
                    <asp:GridView ID="gvCourse" runat="server" AllowPaging="True" AlternatingRowStyle-CssClass="GridItemAltername"
                        AutoGenerateColumns="False" CssClass="Grid" DataKeyNames="Id" FooterStyle-CssClass="GridHeaderFooter"
                        HeaderStyle-CssClass="GridHeaderFooter" PagerStyle-CssClass="GridPager" OnPageIndexChanging="gvCourse_PageIndexChanging"
                        OnRowCancelingEdit="gvCourse_RowCancelingEdit" OnRowDataBound="gvCourse_RowDataBound"
                        OnRowDeleting="gvCourse_RowDeleting" OnRowEditing="gvCourse_RowEditing" OnRowUpdating="gvCourse_RowUpdating"
                        Width="80%">
                        <AlternatingRowStyle CssClass="GridItemAltername" />
                        <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    م
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <%# Container.DataItemIndex + 1 %>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="Grad_name" HeaderText="الصف" ReadOnly="True" SortExpression="Grad_name" />
                            <asp:BoundField DataField="Sub_name" HeaderText="المادة" ReadOnly="True" SortExpression="Sub_name" />
                            <asp:TemplateField HeaderText="الوحدة" SortExpression="Course_Name">
                                <EditItemTemplate>
                                    <asp:TextBox ID="txt_Name_E" runat="server" Text='<%# Bind("Course_Name") %>'></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" ControlToValidate="txt_Name_E"
                                        Display="Dynamic" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Course_Name") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="الوصف" SortExpression="Description">
                                <EditItemTemplate>
                                    <asp:TextBox ID="txt_Dis_E" runat="server" Text='<%# Bind("Description") %>' TextMode="MultiLine"></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("Description") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:CommandField CancelText="إلغاء" EditText="تعديل" ShowEditButton="True" UpdateText="تحــديث" />
                            <asp:TemplateField ShowHeader="False">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lkdelete" runat="server" CausesValidation="False" CommandName="Delete"
                                        Text="حذف"></asp:LinkButton>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:TemplateField>
                        </Columns>
                        <FooterStyle CssClass="GridHeaderFooter" />
                        <HeaderStyle CssClass="GridHeaderFooter" />
                        <PagerStyle CssClass="GridPager" />
                    </asp:GridView>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </div>
</asp:Content>
